﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            姓名：<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox><asp:RequiredFieldValidator  ID="RequiredFieldValidator1" runat="server" InitialValue="admin" ControlToValidate="TextBox1" ErrorMessage="不能为空，且不能为admin！" Display="Dynamic" Font-Bold="True"></asp:RequiredFieldValidator>
            <br />
            密码：<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="不能为空" ControlToValidate="TextBox2"></asp:RequiredFieldValidator>
            <br />
            再次输入密码：<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox><asp:CompareValidator ID="CompareValidator1" runat="server" ErrorMessage="两次密码不一致！" ControlToCompare="TextBox2" ControlToValidate="TextBox3"></asp:CompareValidator>
            <br />
            年龄：<asp:TextBox ID="TextBox4" runat="server"></asp:TextBox><asp:RangeValidator ID="RangeValidator1" runat="server" MinimumValue="0" MaximumValue="100" ErrorMessage="年龄必须0~100" Type="Integer" Display="Dynamic"  ControlToValidate="TextBox4"></asp:RangeValidator>
            <br />
            出生日期：<asp:TextBox ID="TextBox5" runat="server"></asp:TextBox><asp:RangeValidator ID="RangeValidator2" runat="server" MinimumValue="1900-01-01" MaximumValue="2021-07-01" ErrorMessage="出生日期超出范围！"  ControlToValidate="TextBox5"></asp:RangeValidator>
            <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="格式不对，正确格式：2000-05-23"  ControlToValidate="TextBox5" ValidationExpression="^\d{4}-\d{2}-\d{2}$"></asp:RegularExpressionValidator>
            <br />
            毕业时间：<asp:TextBox ID="TextBox6" runat="server"></asp:TextBox><asp:CompareValidator ID="CompareValidator2" runat="server" ErrorMessage="不能早于出生日期" ControlToCompare="TextBox5" ControlToValidate="TextBox6" Type="Date" Operator="GreaterThan"></asp:CompareValidator>
           <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="格式不对，正确格式：2000-05-23" ValidationExpression="^\d{4}-\d{2}-\d{2}$" ControlToValidate="TextBox6"></asp:RegularExpressionValidator>
           
              <br />
              邮箱：<asp:TextBox ID="TextBox7" runat="server"></asp:TextBox><asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="格式不对" ControlToValidate="TextBox7" ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
            
            <br />
            <asp:Button ID="Button1" runat="server" Text="提交"  OnClick="Button1_Click"  />
            <br />
            <asp:Literal ID="Literal1" runat="server"></asp:Literal>
            <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="List" />
        <a href="WebForm2.aspx">去登陆</a>
        </div>
    </form>
</body>
</html>
